<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: 用户
  Date: 2021/11/18
  Time: 10:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--<%@include file="loginController.jsp"%>--%>
<html>
<head>
    <title>我的账单</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <script src="layui/layui.js"></script>
</head>
<body>
<div class="layui-col-md8 layui-col-md-offset3" style="margin-top: 40px;margin-left: 230px">
    <button class="layui-btn" id="btn_return" style="margin-left: 170px">返回我的账户</button>

    <div class="layui-col-md7 layui-col-md-offset3" style="margin-top: 40px">
        <table class="layui-hide" id="accountList"></table>
    </div>
</div>
<script>
    layui.use(['form', 'layer', 'table'], function () {
        var table = layui.table;
        var form = layui.form;
        //layui中内置了jquery只需要声明$
        var $ = layui.$;
        table.render({
            id: 'accountList'
            , elem: '#accountList'
            , url: '/accountListServlet'
            , cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            , cols: [[
                {type:'numbers',width: 76}
                // , {field: 'id', , title: ''}
                , {field: 'dealType', width: 100, title: '交易类型', sort: true}
                , {field: 'petName', width: 100, title: '宠物名称'}
                , {field: 'storeName', width: 100, title: '交易商店' }
                , {field: 'price', width: 100, title: '价格' , sort: true}
                , {field: 'dealTime', width: 120, title: '交易时间' , sort: true}
            ]]
            , page: true
            , limit: 5
            , limits: [5, 10, 15]
        });

        //返回我的账户
        $("#btn_return").click(function () {
            window.location.href = "petOwner.jsp";
        })
    });
</script>
</body>
</html>
